Home

My AWS Café Application Optimization Project

Project Overview

I recently completed an optimization project for the Café web application on AWS. This activity required me to optimize the AWS resources used to run the Café web application. Specifically, I had to:

After completing this activity, I was able to:

The business case for this was a new requirement for Café – to optimize resources to reduce AWS service costs.

After the migration to Amazon Relational Database Service (Amazon RDS) was completed (an action taken in a prior activity), I identified optimization opportunities to implement to reduce AWS service costs. First, I realized that the decommissioned local database could be uninstalled to reduce the storage requirements of the Café instance. I also realized that the Café instance could be downsized to a smaller instance type because the database process was no longer running on it.

Task 1: Optimize the website to reduce costs

Because the local database was migrated to Amazon RDS, I could reduce AWS service costs by performing the following actions on the Café EC2 instance:

In this task, I used the AWS Command Line Interface (AWS CLI) to perform these actions. I began by opening a Secure Shell (SSH) session to the Café instance and the CLI Host.

Task 1.1.3: Configure the AWS CLI

Before I could run AWS CLI commands on the instance, I first had to configure the AWS CLI environment to define the AWS account credentials, Region name, and output format to use.

I left this terminal window SSH session open to use it later in the activity.

Task 1.2: Connect to the CLI Host instance by using SSH

Task 1.3: Uninstall MariaDB and resize the instance

Information: Because I restarted the instance, Amazon EC2 assigned a different Public DNS name and Public IP address to the instance than what it had before.

I successfully uninstalled the decommissioned local database and downsized the Café instance.

Task 2: Use the AWS Pricing Calculator to estimate AWS service costs

AWS provides a tool that allows users to estimate the monthly costs of the AWS services that they use or are planning to use. In this task, I used the AWS Pricing Calculator to estimate the cost of running the Café website on AWS before and after EC2 instance optimization. I then calculated the projected cost savings.

NOTE: The values that I entered into the AWS Pricing Calculator were simplified to serve the purposes of this exercise. The intent was to show the basic use of the calculator and highlight the functions that it provides.

The pricing examples shown in this activity were current as of time of publishing, April 2020, and is for informational purposes. Refer to the AWS website for current pricing by service.

Task 2.1: Calculate the costs before optimization

First, I calculated the costs of running the website in its before optimization topology, that is, on a T3 small instance with a decommissioned local database still occupying storage space.

Specifically, I used the following service list and configuration to describe the topology components:

Region: (the region where the CafeInstance EC2 instance is running)

Amazon EC2 instance:

Amazon RDS instance:

I had now estimated the cost of the EC2 instance.

Next, I added the RDS instance to my price estimate.

Task 2.2: Calculate the costs after optimization

Next, I calculated the costs of running the website after the Café instance was optimized. Specifically, I modified the following entries in the calculator to reflect the effects of the optimization:

Amazon EC2 instance:

Task 2.3: Estimate the projected cost savings for Café

Because I calculated the costs of the AWS services that are needed to run the Café website both before and after I optimized the instance, I could estimate the overall projected cost savings.

By removing the decommissioned local database and downsizing the Café instance type, I saved more in AWS service costs.

Martha and Frank were very happy that my initiative resulted in cost savings for the business.

Related Topics